<div class="dux-tools">
  <div class="bread-head">蜘蛛爬行 <span class="small">管理网站蜘蛛爬行记录</span> </div>
  <br>
  <div class="tools-function clearfix">
    <div class="float-left"> <a class="button button-small bg-main icon-list" href="__URL__"> 记录列表</a> </div>
  </div>
</div>
<div class="admin-main">
  <div class="panel dux-box">
    <div class="table-responsive">
      <table id="table" class="table table-hover ">
        <tbody>
          <tr>
            <th width="60">选择</th>
            <th width="100">蜘蛛名称</th>
            <th width="*">最后来访时间</th>
            <th width="*">IP地址</th>
            <th width="*">被访地址</th>
          </tr>
          <!--foreach:{$list $v}-->
          <tr>
            <td><input type="checkbox" name="id[]" value="<?php echo $v['id']; ?>" /></td>
            <td><?php echo model('spider')->get_bot_name($v['bot']);?></td>
            <td>{$php(echo date('Y-m-d H:i:s',$v['time']))}</td>
            <td><?php echo $v['ip']?></td>
            <td><?php echo $v['url']?></td>
          </tr>
         <!--{/foreach}-->
        </tbody>
      </table>
    </div>
    <div class="panel-foot table-foot clearfix">
      <div class="float-left">
        <div class="form-inline">
          <div class="form-button"> <a class="button bg-blue button-small" onclick="javascript:selectall('id[]');" type="button">全选</a>
          <?php if(model('user_group')->model_power('spider','del')){ ?>
          <a class="button bg-blue button-small" onclick="javascript:audit(1);" type="submit">删除</a>
          <?php } ?>
           </div>
        </div>
        <br>
      </div>
      <div class="float-right">
      	<div class="page_tool">
        <div class="page" >{$page}</div>
        </div>
      </div>
    </div>
  </div>
<script>
//选择
function selectall(name){   
    $("[name='"+name+"']").each(function(){//反选   
    if($(this).attr("checked")){   
          $(this).removeAttr("checked");   
    }else{   
          $(this).attr("checked",'true');   
    }   
    })  
}
//批量操作
function audit(status){
	var str="";
	$("[name='id[]']").each(function(){//反选   
    if($(this).attr("checked")){
		  str+=$(this).val()+","; 
    }
    })
	
	ajaxpost({
		name:'您确认要继续进行操作吗？操作将无法撤销！',
		url:"__URL__/batch",
		data:{status: status, id:str},
		tip:1,
		success:function(){
			window.location.reload();	
		}
	});
}
</script></div>
